package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 借款记录、还款记录
 */
public class SmallLoanRecord implements Parcelable {
    public SmallLoanRecord() {
    }

    // 还款记录
    public SmallLoanRecord(String repayingPlanDetailId, String currentEndDate, double currentPrincipalInterest, String status, String statusName) {
        this.repayingPlanDetailId = repayingPlanDetailId;
        this.currentEndDate = currentEndDate;
        this.currentPrincipalInterest = currentPrincipalInterest;
        this.status = status;
        this.statusName = statusName;
    }

    // 借款记录
    public SmallLoanRecord(String loanId, double origPrcp, String loanTime, String status, String statusName) {
        this.loanId = loanId;
        this.loanTime = loanTime;
        this.origPrcp = origPrcp;
        this.status = status;
        this.statusName = statusName;
    }

    public SmallLoanRecord(String loanId, double origPrcp, String loanTime, String status, String statusName, String bankCardNo, String endDate) {
        this.loanId = loanId;
        this.loanTime = loanTime;
        this.origPrcp = origPrcp;
        this.status = status;
        this.statusName = statusName;
        this.bankCardNo = bankCardNo;
        this.endDate = endDate;
    }

    /**
     * overFee : 0
     * repayedInterest : 2583.33
     * endCurrentInterest : 2583.33
     * repayedTotalamount : 302583.33
     * repayedImposeInterest : 0
     * overInt : 0
     * currentPrincipal : 300000
     * repayingPlanDetailId : 0ecb6070a29a459082ed5583ff9dd189
     * currentPrincipalInterest : 302583.33
     * endCurrentPrincipalBalance : 0
     * repayingPlanId : 61854e7beb13419e8da9f6ae626a6704
     * currentInterest : 2583.33
     * derateFee : 0
     * endCurrentPrincipal : 300000
     * currentEndDate : 2021-08-20
     * repayingDate : null
     * statusName : 已还
     * currentFee : 0
     * currentPeriod : 1
     * repayedFee : 0
     * status : 2
     * repayedPrincipal : 300000
     */
    /*---------------------------------------------------------还款记录---------------------------------------------------------*/
    // 还款计划明细ID
    private String repayingPlanDetailId;
    // 还款计划ID
    private String repayingPlanId;
    // 期数
    private int currentPeriod;
    // 状态id 0未还，1正常部分还款，2已还，3逾期，4停止计息，5已冲正，7期部分还款，8还款中，18冲正处理中 当期本金、利息、罚息、复利、费用如果有未结清的，则该标志为'Y'
    private String status;
    // 状态
    private String statusName;
    // 计划还款日
    private String currentEndDate;
    // 实际还款日期
    private String repayingDate;
    // 应还本金
    private double currentPrincipal;
    // 应还利息
    private double currentInterest;
    // 应还总额本息
    private double currentPrincipalInterest;
    // 截止当期累计应还本金
    private double endCurrentPrincipal;
    // 截止当期累计应还利息
    private double endCurrentInterest;
    // 截至当期本金余额
    private double endCurrentPrincipalBalance;
    // 逾期手续费
    private double overFee;
    // 逾期利息
    private double overInt;
    // 已还本金
    private double repayedPrincipal;
    // 已还利息
    private double repayedInterest;
    // 已还总金额
    private double repayedTotalamount;
    // 已还逾期利息
    private int repayedImposeInterest;
    // 应还费用
    private double currentFee;
    // 减免费用
    private double derateFee;
    // 已还费用
    private double repayedFee;
    // 用户id
    private String userId;
    // 还款类型：提前结清、正常还款
    private String preRepayTypeName;
    // 还款类型：1 = 提前结清、2 = 正常还款
    private String preRepayType;

    /*---------------------------------------------------------借款记录---------------------------------------------------------*/
    /**
     * loanTime : 2021-08-17
     * origPrcp : 300000
     * loanId : 58387c0178364cc7b2044453b6e73925
     */
    // 借款id
    private String loanId;
    // 借款日期(合同起始日期)
    private String loanTime;
    // 借款金额
    private double origPrcp;
    // 银行卡
    private String bankCardNo;
    // 计划还款日期(合同结束日期)
    private String endDate;
    // 还款方式
    private String loanPaymTyp;

    public String getRepayingPlanDetailId() {
        return repayingPlanDetailId;
    }

    public void setRepayingPlanDetailId(String repayingPlanDetailId) {
        this.repayingPlanDetailId = repayingPlanDetailId;
    }

    public String getRepayingPlanId() {
        return repayingPlanId;
    }

    public void setRepayingPlanId(String repayingPlanId) {
        this.repayingPlanId = repayingPlanId;
    }

    public int getCurrentPeriod() {
        return currentPeriod;
    }

    public void setCurrentPeriod(int currentPeriod) {
        this.currentPeriod = currentPeriod;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getCurrentEndDate() {
        return currentEndDate;
    }

    public void setCurrentEndDate(String currentEndDate) {
        this.currentEndDate = currentEndDate;
    }

    public String getRepayingDate() {
        return repayingDate;
    }

    public void setRepayingDate(String repayingDate) {
        this.repayingDate = repayingDate;
    }

    public double getCurrentPrincipal() {
        return currentPrincipal;
    }

    public void setCurrentPrincipal(double currentPrincipal) {
        this.currentPrincipal = currentPrincipal;
    }

    public double getCurrentInterest() {
        return currentInterest;
    }

    public void setCurrentInterest(double currentInterest) {
        this.currentInterest = currentInterest;
    }

    public double getCurrentPrincipalInterest() {
        return currentPrincipalInterest;
    }

    public void setCurrentPrincipalInterest(double currentPrincipalInterest) {
        this.currentPrincipalInterest = currentPrincipalInterest;
    }

    public double getEndCurrentPrincipal() {
        return endCurrentPrincipal;
    }

    public void setEndCurrentPrincipal(double endCurrentPrincipal) {
        this.endCurrentPrincipal = endCurrentPrincipal;
    }

    public double getEndCurrentInterest() {
        return endCurrentInterest;
    }

    public void setEndCurrentInterest(double endCurrentInterest) {
        this.endCurrentInterest = endCurrentInterest;
    }

    public double getEndCurrentPrincipalBalance() {
        return endCurrentPrincipalBalance;
    }

    public void setEndCurrentPrincipalBalance(double endCurrentPrincipalBalance) {
        this.endCurrentPrincipalBalance = endCurrentPrincipalBalance;
    }

    public double getOverFee() {
        return overFee;
    }

    public void setOverFee(double overFee) {
        this.overFee = overFee;
    }

    public double getOverInt() {
        return overInt;
    }

    public void setOverInt(double overInt) {
        this.overInt = overInt;
    }

    public double getRepayedPrincipal() {
        return repayedPrincipal;
    }

    public void setRepayedPrincipal(double repayedPrincipal) {
        this.repayedPrincipal = repayedPrincipal;
    }

    public double getRepayedInterest() {
        return repayedInterest;
    }

    public void setRepayedInterest(double repayedInterest) {
        this.repayedInterest = repayedInterest;
    }

    public double getRepayedTotalamount() {
        return repayedTotalamount;
    }

    public void setRepayedTotalamount(double repayedTotalamount) {
        this.repayedTotalamount = repayedTotalamount;
    }

    public int getRepayedImposeInterest() {
        return repayedImposeInterest;
    }

    public void setRepayedImposeInterest(int repayedImposeInterest) {
        this.repayedImposeInterest = repayedImposeInterest;
    }

    public double getCurrentFee() {
        return currentFee;
    }

    public void setCurrentFee(double currentFee) {
        this.currentFee = currentFee;
    }

    public double getDerateFee() {
        return derateFee;
    }

    public void setDerateFee(double derateFee) {
        this.derateFee = derateFee;
    }

    public double getRepayedFee() {
        return repayedFee;
    }

    public void setRepayedFee(double repayedFee) {
        this.repayedFee = repayedFee;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPreRepayTypeName() {
        return preRepayTypeName;
    }

    public void setPreRepayTypeName(String preRepayTypeName) {
        this.preRepayTypeName = preRepayTypeName;
    }

    public String getPreRepayType() {
        return preRepayType;
    }

    public void setPreRepayType(String preRepayType) {
        this.preRepayType = preRepayType;
    }

    public String getLoanId() {
        return loanId;
    }

    public void setLoanId(String loanId) {
        this.loanId = loanId;
    }

    public String getLoanTime() {
        return loanTime;
    }

    public void setLoanTime(String loanTime) {
        this.loanTime = loanTime;
    }

    public double getOrigPrcp() {
        return origPrcp;
    }

    public void setOrigPrcp(double origPrcp) {
        this.origPrcp = origPrcp;
    }

    public String getBankCardNo() {
        return bankCardNo;
    }

    public void setBankCardNo(String bankCardNo) {
        this.bankCardNo = bankCardNo;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getLoanPaymTyp() {
        return loanPaymTyp;
    }

    public void setLoanPaymTyp(String loanPaymTyp) {
        this.loanPaymTyp = loanPaymTyp;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.repayingPlanDetailId);
        dest.writeString(this.repayingPlanId);
        dest.writeInt(this.currentPeriod);
        dest.writeString(this.status);
        dest.writeString(this.statusName);
        dest.writeString(this.currentEndDate);
        dest.writeString(this.repayingDate);
        dest.writeDouble(this.currentPrincipal);
        dest.writeDouble(this.currentInterest);
        dest.writeDouble(this.currentPrincipalInterest);
        dest.writeDouble(this.endCurrentPrincipal);
        dest.writeDouble(this.endCurrentInterest);
        dest.writeDouble(this.endCurrentPrincipalBalance);
        dest.writeDouble(this.overFee);
        dest.writeDouble(this.overInt);
        dest.writeDouble(this.repayedPrincipal);
        dest.writeDouble(this.repayedInterest);
        dest.writeDouble(this.repayedTotalamount);
        dest.writeInt(this.repayedImposeInterest);
        dest.writeDouble(this.currentFee);
        dest.writeDouble(this.derateFee);
        dest.writeDouble(this.repayedFee);
        dest.writeString(this.userId);
        dest.writeString(this.preRepayTypeName);
        dest.writeString(this.preRepayType);
        dest.writeString(this.loanId);
        dest.writeString(this.loanTime);
        dest.writeDouble(this.origPrcp);
        dest.writeString(this.bankCardNo);
        dest.writeString(this.endDate);
        dest.writeString(this.loanPaymTyp);
    }

    protected SmallLoanRecord(Parcel in) {
        this.repayingPlanDetailId = in.readString();
        this.repayingPlanId = in.readString();
        this.currentPeriod = in.readInt();
        this.status = in.readString();
        this.statusName = in.readString();
        this.currentEndDate = in.readString();
        this.repayingDate = in.readString();
        this.currentPrincipal = in.readDouble();
        this.currentInterest = in.readDouble();
        this.currentPrincipalInterest = in.readDouble();
        this.endCurrentPrincipal = in.readDouble();
        this.endCurrentInterest = in.readDouble();
        this.endCurrentPrincipalBalance = in.readDouble();
        this.overFee = in.readDouble();
        this.overInt = in.readDouble();
        this.repayedPrincipal = in.readDouble();
        this.repayedInterest = in.readDouble();
        this.repayedTotalamount = in.readDouble();
        this.repayedImposeInterest = in.readInt();
        this.currentFee = in.readDouble();
        this.derateFee = in.readDouble();
        this.repayedFee = in.readDouble();
        this.userId = in.readString();
        this.preRepayTypeName = in.readString();
        this.preRepayType = in.readString();
        this.loanId = in.readString();
        this.loanTime = in.readString();
        this.origPrcp = in.readDouble();
        this.bankCardNo = in.readString();
        this.endDate = in.readString();
        this.loanPaymTyp = in.readString();
    }

    public static final Creator<SmallLoanRecord> CREATOR = new Creator<SmallLoanRecord>() {
        @Override
        public SmallLoanRecord createFromParcel(Parcel source) {
            return new SmallLoanRecord(source);
        }

        @Override
        public SmallLoanRecord[] newArray(int size) {
            return new SmallLoanRecord[size];
        }
    };
}
